Repository navigation
fix(images): constrain downloads and validate image payloads - #3
Conversation
|
Maintainer review: the new downloader meaningfully reduces risk by constraining origins, validating redirects, checking MIME/signature agreement, limiting streamed bytes, and writing through a temporary file. The bounded worker pool is also a better fit than launching 50 concurrent fetches. I’m checking the regression suite and Actions result before final approval; the current allowlist is deliberately limited to the GameMonetize host used by the feed. |
SH20RAJ
left a comment
There was a problem hiding this comment.
Reviewed the updated image downloader and regression suite. The origin allowlist, redirect revalidation, streamed byte cap, MIME/signature checks, safe filename handling, atomic writes, and concurrency bound are all covered by the implementation and tests. GitHub Actions completed successfully: Bun tests and the Next.js production build both passed. Approved.
Summary
Content-Lengthand streamed bytes.Validation
tests/download-images.test.ts.bun testonce merged.Compatibility note
The current repository feed uses
img.gamemonetize.comthumbnails. The explicit allowlist is intentional; adding another image provider should be a deliberate allowlist change rather than permitting arbitrary URLs.